<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [
	<!ENTITY nbsp "&#x00A0;">
]>
<xsl:stylesheet
	version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:msxml="urn:schemas-microsoft-com:xslt"
	xmlns:umbraco.library="urn:umbraco.library"
	xmlns:twitter.library="urn:twitter.library"
	xmlns:georss="http://www.georss.org/georss"
	exclude-result-prefixes="msxml umbraco.library twitter.library">
	<xsl:output method="xml" omit-xml-declaration="yes"  />

	<xsl:template match="status">
		<xsl:variable name="statusUrl" select="concat('http://twitter.com/', user/screen_name, '/status/', id)" />
		<xsl:comment>
			<xsl:value-of select="$statusUrl" />
		</xsl:comment>
		<style type="text/css">
			.bbpBox<xsl:value-of select="id" />{background:url(<xsl:value-of select="user/profile_background_image_url" />) #<xsl:value-of select="user/profile_background_color" />;padding:20px;} p.bbpTweet{background:#fff;padding:10px 12px 10px 12px;margin:0;min-height:48px;color:#<xsl:value-of select="user/profile_text_color" />;font-size:18px !important;line-height:22px;-moz-border-radius:5px;-webkit-border-radius:5px} p.bbpTweet span.metadata{display:block;width:100%;clear:both;margin-top:8px;padding-top:12px;height:40px;border-top:1px solid #fff;border-top:1px solid #e6e6e6} p.bbpTweet span.metadata span.author{line-height:19px} p.bbpTweet span.metadata span.author img{float:left;margin:0 7px 0 0px;width:38px;height:38px} p.bbpTweet a{color:#<xsl:value-of select="user/profile_link_color" />!important;} p.bbpTweet a:hover{text-decoration:underline}p.bbpTweet span.timestamp{font-size:12px;display:block}
		</style>
		<div class="bbpBox{id}">
			<p class='bbpTweet'>
				<xsl:value-of select="twitter.library:FormatUrls(text)" />
				<span class='timestamp'>
					<a title="{twitter.library:FormatTwitterDate(created_at)}" href="{$statusUrl}">
						<xsl:value-of select="twitter.library:GetPrettyDate(created_at, 'dd MMMM yyyy')" />
					</a>
					<xsl:text><![CDATA[ via ]]></xsl:text>
					<xsl:value-of select="source" />
				</span>
				<span class="metadata">
					<span class="author">
						<a href="http://twitter.com/{user/screen_name}">
							<img src="{user/profile_image_url}" />
						</a>
						<strong>
							<a href="http://twitter.com/{user/screen_name}">
								<xsl:value-of select="user/name" />
							</a>
						</strong>
						<br />
						<xsl:value-of select="user/screen_name" />
					</span>
				</span>
			</p>
		</div>
		<xsl:comment>
			<xsl:text><![CDATA[end of tweet]]></xsl:text>
		</xsl:comment>
	</xsl:template>

</xsl:stylesheet>